<!-- BEGIN PAGE HEADER-->
<?php $this->load->view('partials/breadcrumb.tpl')?>
<!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT-->
<script type="text/javascript">
function defConfirm(url){
	if(!confirm("确定要删除吗？")){
		return false;
	}
	window.location.href = url;
	return true;
}

$(document).ready(function(){
	$("#reset").click(function(){
		$("select").val('');
		$("input[type='text']").val('');
	});
});
</script>
<div class="row">
	<div class="col-md-12">
		<!-- Begin: life time stats -->
		<div class="portlet">
			<?=form_open('', Array('class'=>'form-inline', 'role'=>'form'))?>
				<?=search_form_input('name',filterValue('name'),'名称...', 'class="form-control input-medium"');?>
				<?=search_form_input('code',filterValue('code'),'标识...', 'class="form-control input-medium"');?>
				<?=search_form_input('gateway',filterValue('gateway'),'网关...', 'class="form-control input-medium"');?>
				<?=search_form_input('sort',filterValue('sort'),'排序位置...', 'class="form-control input-medium"');?>
				<?=search_form_dropdown('sort_type',Array(''=>'按添加先后排序...', '1'=>'按使用中顺序排序'),filterValue('sort_type'),'排序方式', 'class="form-control input-medium"');?>
				<?=search_form_dropdown('status',Array(''=>'选择状态...', '1'=>'启用', '0'=>'禁用'),filterValue('status'),'状态', 'class="form-control input-medium"');?>
				<button type="button" class="btn default" id="reset">重置条件</button>
				<button type="submit" class="btn green about_search">搜索 <i class="fa fa-search"></i></button>
			<?=form_close()?>
			<div class="portlet-body">
				<div class="row">
					<div class="col-md-12">
						<div class="table-scrollable">
							<table class="table table-hover table-bordered table-striped">
								<thead>
								<tr>
									<th width="5%">编号</th>				
									<th width="10%">名称</th>				
									<th width="5%">标识</th>
									<th width="5%">网关</th>
									<th width="40%">温馨提示</th>
									<th width="10%">限额</th>
									<th width="5%">排序</th>
									<th width="5%">状态</th>
									<th width="10%">操作</th>
								</tr>
								</thead>
								<tbody>
								<?php  foreach ($list as $node){	?>
									<tr>
										<td>
											<span><?=htmlspecialchars($node->id)?></span>
										</td>
										<td>
										<?php if($p->edit){?><a href="<?=site_url($thisModule.$thisController.'/edit/'.$node->id)?>"><?php }?>
										<span><?=htmlspecialchars($node->name)?></span>
										<?php if($p->edit){?></a><?php }?>
										</td>
										<td><?=htmlspecialchars($node->code)?></td>
										<td><?=htmlspecialchars($node->gateway)?></td>
										<td><?=htmlspecialchars($node->description)?></td>
										<td><?=htmlspecialchars($node->configs)?></td>
										<td><?=$node->sort?></td>
										<td><?=($node->status == 0 ? '<span class="label label-danger status_icons label_status_icons">禁用</span>' : '<span class="label label-success status_icons label_status_icons">启用</span>')?></td>
										<td>
										<?php if($p->delete){?>
										<a class="black" href="javascript:void(defConfirm('<?=site_url($thisModule.$thisController.'/delete/'.$node->id.'/'.$node->update_time) ?>'));"><i class="fa fa-trash-o"></i> <?=l('delete')?></a>
										<?php }?>
										</td>
									</tr>
								<?php }?>
								</tbody>
							</table>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-md-12 text-right">
						<?=$pagination?>
					</div>
				</div>
			</div>
		</div>
		<!-- End: life time stats -->
	</div>
</div>

<!-- END PAGE CONTENT-->
